home *** CD-ROM | disk | FTP | other *** search
/ Die Speccy' 97 / Die Speccy' 97.iso / amiga_system / the_aminet / comm / bbs / bbbbs85.lha / rexx / bbsCallBack.baud < prev    next >
Text File  |  1995-01-19  |  4KB  |  176 lines

  1. /* $VER: bbsCallBack.baud 8.4 (19.1.95) */
  2.  
  3. OPTIONS RESULTS
  4. ARG name colorflag nosounds password 
  5. bbspath=GETCLIP('BBS_path')
  6. bbsname=GETCLIP('BBS_bbsname')
  7. bbsvers=GETCLIP('BBS_version')
  8. namemask=COMPRESS(XRANGE(),XRANGE('A','Z')' _-')
  9. CR='0D'x;lineup='1B'x'M'
  10. def='';pen2='';pen3='';pen7=''
  11. IF colorflag=0 THEN DO;def='';pen2='';pen3='';pen7='';END
  12. telnum=getinput(0 pen7'Please Enter Phone Number For Call Back: 'def )
  13. mask=COMPRESS(XRANGE(),'0123456789-, @#*')
  14. telnum=COMPRESS(telnum,mask)
  15. IF telnum='' THEN EXIT 0
  16.  
  17. DO n=1 WHILE n<LENGTH(telnum) & ~DATATYPE(SUBSTR(telnum,n,1),'W')
  18. END
  19. IF SUBSTR(telnum,n,1)<2 THEN
  20.   DO
  21.     SAY 'No long distance numbers, please!'CR
  22.     EXIT 0
  23.   END
  24. temp='The BBS will now call' telnum 'to verify. Correct? (Ny) > '
  25. IF getinput(1 temp)~='Y' THEN EXIT 0
  26. IF nosounds~=1 THEN ADDRESS AREXX bbsSounds.rexx bbspath'Sounds/' 'CBV'
  27. telnum=COMPRESS(telnum)
  28. CALL SETCLIP('CALLBACK',telnum)
  29. SAY pen3'Logging Off. Callback to' telnum 'in 30 seconds.'def||CR
  30. SAY 'If your modem does not answer by itself after the first RING,'CR
  31. SAY ' type  ATA  and press RETURN to force your modem to answer.'CR
  32. SAY CR
  33. SAY pen2'GoodBye for now,' name '.'def||CR
  34. REMOTE OFF
  35. Timeout 10
  36. Send '\ah'
  37. Wait 'OK,RING'
  38. IF RESULT~='OK' THEN
  39.   DO
  40.     Send '\d'
  41.     Wait 'OK,RING'
  42.     IF RESULT~='OK' THEN EXIT 0
  43.   END
  44. CALL DELAY(50)
  45. Send 'ATH1\r'
  46. SAY CR
  47. CALL DELAY(99)
  48. SAY CR
  49. DO n=14 TO 1 BY -1
  50.   MSG '1B'x'M' n*2 'seconds left before CBV callback...'
  51.   CALL DELAY(99)
  52. END
  53. MSG lineup 'Beginning CBV callback...               '
  54. SAY CR
  55. Timeout 10
  56. Send '\ah'
  57. Wait 'OK'
  58. IF RESULT~='OK' THEN
  59.   DO
  60.     Send '\d'
  61.     Wait 'OK'
  62.     IF RESULT~='OK' THEN EXIT 0
  63.   END
  64. CALL DELAY(50)
  65. Send 'ATL3M1DT'telnum'\r'  /* M1 = Speaker ON, L3 = volume up */
  66. Timeout 90
  67. Wait 'CONNECT,NO CARRIER,BUSY,ERROR'
  68. IF RESULT~='CONNECT' THEN 
  69.   DO
  70.     CALL upCBV('FAILED')
  71.     EXIT 1
  72.   END
  73. REMOTE ON
  74. DO i=1 TO 14
  75.   SAY CR
  76. END
  77. SAY CENTER(bbsvers,75)||CR
  78. SAY CR
  79. SAY CENTER(bbsname 'Call Back Identity Verification',74)||CR
  80. SAY CR
  81. Timeout 150
  82. DO cnt=1 TO 3
  83.   Namentr=getinput(0 pen3'    Enter Name: 'def)
  84.   Namentr=cleanstring('1:'Namentr)
  85.   IF Namentr=name THEN LEAVE cnt
  86. END
  87. DO count=1 TO 4
  88.   IF cnt>3 | count>3 THEN
  89.     DO
  90.       SAY 'Incorrect Entry!'||CR
  91.       SAY 'Verification Denied.'||CR
  92.       SAY pen2'Leave a 'pen3'['pen7'C'pen3']omment'pen2' to SysOp' pen2'for manual verification.'def||CR
  93.       SAY CR
  94.       CALL upCBV('DENIED')
  95.       EXIT 1
  96.     END
  97.   pw=getinput(0 pen3'Enter Password: 'def)
  98.   IF UPPER(pw)=password THEN
  99.     DO
  100.       CALL upCBV('VERIFIED')
  101.       v=GETCLIP('BBS_COMMAND')
  102.       CALL SETCLIP('BBS_COMMAND',v'V')
  103.       EXIT 0
  104.     END
  105. END
  106. EXIT 0
  107.  
  108.  
  109. getinput:
  110. PARSE ARG oneflag' 'pline
  111. CALL checkdcd()
  112. OPTIONS PROMPT pline
  113. PULL inarg
  114. inarg=STRIP(inarg)
  115. IF oneflag THEN inarg=LEFT(inarg,1)
  116. inarg=cleanstring(0':'inarg)
  117. RETURN inarg
  118.  
  119.  
  120. cleanstring:
  121. PARSE ARG nflag':'cstr
  122. IF nflag=1 THEN
  123.   DO
  124.     cstr=COMPRESS(cstr,"'`")
  125.     cstr=TRANSLATE(cstr,,namemask)
  126.     cstr=SPACE(cstr,1,'_')
  127.     RETURN cstr
  128.   END
  129. bot=XRANGE(,'1F'x)
  130. top=XRANGE('7F'x)
  131. cstr=COMPRESS(cstr,bot||top)
  132. cstr=STRIP(cstr)
  133. RETURN cstr
  134.  
  135.  
  136. checkdcd:
  137. dcd
  138. IF RC=0 THEN
  139.   DO
  140.     DO dcds=1 TO 3  /* 5 second delay */
  141.       CALL DELAY(50)
  142.       dcd
  143.       IF RC~=0 THEN RETURN
  144.     END
  145.     dcd
  146.     IF RC=0 THEN EXIT 0
  147.   END
  148. xmsg=GETCLIP('BBS_MESSAGE')
  149. IF xmsg~='' THEN
  150.   DO
  151.     SAY CR
  152.     SAY bak2' Message From BBBBS: 'def||CR
  153.     SAY xmsg||CR
  154.     SAY CR
  155.     CALL SETCLIP('BBS_MESSAGE')
  156.   END
  157. IF POS('G',GETCLIP('BBS_COMMAND'))>0 THEN EXIT 1
  158. RETURN
  159.  
  160.  
  161. upCBV:
  162. ARG res .
  163. temp=bbspath'Lists/CBV_USERS'
  164. IF EXISTS(temp) THEN t2='A'
  165. ELSE t2='W'
  166. x=OPEN(f,temp,t2)
  167. IF x=0 THEN RETURN 1
  168. IF t2='W' THEN CALL WRITELN(f,'*** Call Back Verify Log ***')
  169. temp=RIGHT(TIME('C'),7) COMPRESS(DATE())
  170. temp=temp LEFT(name,24) RIGHT(telnum' RESULT:',20) res
  171. CALL WRITELN(f,temp) 
  172. CALL CLOSE(f)           
  173. RETURN 0
  174.  
  175. /* bbsCallBack.baud */
  176.